(function () {

var worker = new Manager("1.Petar", "Petrov", 30, 8, "Economics");
var workera = new Manager("2.Petar", "Petrov", 30, 8, "Economics");

var building = new ProductionBuilding("Production building", 350, 1000000, false);
var machine = new Machine(3, 4, 19);
var machine2 = new Server(10, 3, 5, 12, "Ubutu", "data processing");
var machine3 = new Vehicle(10, 3, 5, 8,"yes","Van");

building.addMachine(machine);
building.addWorker(worker);
building.addWorker(workera);
building.addMachine(machine2);

var building2 = new AdministrativeBuilding("First admin", 20000, 3000000, true, 100000);
building2.addWorker(new Worker("John", "Bon Jovi", 32, 12));
building2.addWorker(new Expert("Clint", "Eastwood", 70, 48, "Physical education"));
building2.addWorker(new Expert("Regeb", "Evedik", 40, 26, "Quantum mechanics"));

var building3 = new ProductionBuilding("Production 2", 560, 300000, false);
building3.addWorker(new Worker("Tom", "The Cat", 8, 8));
building3.addMachine(new Server(4, 3, 5, 144, "DOS" , "factoring"));
building3.addMachine(new Machine(4, 5, 6));

var branch = new Branch("Sofia", 20000);
branch.addBuilding(building);
branch.addBuilding(building2);

var branch2 = new Branch("Plovdiv", 50000);
var building3 = new AdministrativeBuilding("Plovdiv admin", 2000, 3000000, false);
building3.addWorker(new Worker("Tom", "Tomson", 27, 6));
building3.addWorker(new Manager("Brigo", "Asparuhov", 58, 32, "Military tactics"));

var company = new Company("Kubrat", 3000000);
company.addBranch(branch);
company.addBranch(branch2);
$(document.body).append(company.renderPartial());
$(document.body).append(company.renderFull());
branch2.addBuilding(building3);
console.log($(".company-full").first().html());

}());